<!--title-->
<div class="mnav1">
    <div class="m_nav">
        <div class="nav_left">
            <em class="home_icon"><?=$this->sys_name?></em><span>&nbsp;&gt;&nbsp;</span><font><?=$this->title?></font>
        </div>
    </div>
</div>

<div class="content-table">
    <div class="content-table-title"><?=$this->title?></div>
    <br />
    <?php if($this->msg):?>
        <div class="replace"><?=$this->msg?></div>
        <br />
    <?php endif;?>
    <form action="/maozhua/user-email" name="form1" method="GET">
        状态：
        <input type="checkbox" name="status[]" id="status_0" value="0" <?php if(in_array(0, $this->status_arr)){echo "checked='checked'";}?> /> <label for="status_0">待审核</label>&nbsp;&nbsp;&nbsp;
        <input type="checkbox" name="status[]" id="status_1" value="1" <?php if(in_array(1, $this->status_arr)){echo "checked='checked'";}?> /> <label for="status_1">已审核</label>&nbsp;&nbsp;&nbsp;
        <br>
        关键字：<input type="text" name="keyword" <?php if($this->keyword){echo "value='".$this->keyword."'";}?> />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="submit" class="button" value="搜索" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" class="button-cancle" value="清空搜索条件" onclick="location.href='?';" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" class="button-cancle" value="新增" onclick="location.href='/maozhua/add-user-email';" />
    </form>
    <br />
    <table>
        <tr>
            <th>姓名</th>
            <th>邮箱</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        <?php foreach($this->data as $row): ?>
            <tr>
                <td><?=$row['user_name']?></td>
                <td><?=$row['email']?></td>
                <td><?=$row["status"]?"<font color='green'>已审核</font>":"<font color='red'>待审核</font>"?></td>
                <td><button onclick="window.location.href='/maozhua/edit-user-email/id/<?=$row['id']?>'">编辑</button></td>
            </tr>
        <?php endforeach; ?>
    </table>
    <br /><br />
    <div align="right"><?=$this->pagination?></div>
    <br /><br /><br />

    <script>
        function GetCities(provinceId)
        {
            $.ajax({
                type: "post",
                url : "/ajax/get-cities",
                dataType:'json',
                async:false,
                data: {
                    'provinceId':provinceId
                },
                success: function(json){
                    if(json.result == 1 && typeof(json.data) != "undefined") {
                        var arr = json.data;
                        var txt = "<option value=''>不限</option>";

                        for(i=0; i < arr.length; i++){
                            txt += "<option value='" + arr[i]['cityId'] + "'>" + arr[i]['cityName'] + "</option>";
                        }

                        document.getElementById("cityId").innerHTML = txt;
                    }
                }
            });
        }
    </script>